# app/core/config.py

# 修改后的代码
# from pydantic_settings import BaseSettings
from pydantic import BaseSettings
import os

class Settings(BaseSettings):
    API_PREFIX: str = "/api/v1/hifly"
    API_PREFIX_V1: str = "/api/v1"
    PROJECT_NAME: str = "Your Project Name"
    CONTENT_TYPE: str = "application/json"
    AUTHORIZATION = os.environ.get('AUTHORIZATION_TOKEN', 'Bearer TLgXIUNYSBXUlSzxtCK')
    REPORT: str = "https://hwserver.luzhuofun.com:3009/report_fy_charging"
    TOKEN_REPORT: str = "https://hwserver.luzhuofun.com:3009/login"
    # 外部接口配置
    EXTERNAL_API_URL: str = 'https://hfw-api.lingverse.co/api/v1/hifly/task/create'
    EXTERNAL_CREATE_VOICE_URL: str = 'https://hfw-api.lingverse.co/api/v1/hifly/voice/create'
    EXTERNAL_TRAIN_VOICE_URL: str = 'https://hfw-api.lingverse.co/api/v1/hifly/voice/train'
    EXTERNAL_CONFIRM_VOICE_URL: str = 'https://hfw-api.lingverse.co/api/v1/hifly/voice/confirm'
    EXTERNAL_VOICE_LIST_URL: str = "https://hfw-api.lingverse.co/api/v1/hifly/voice/list"

    # V2版本数字人API配置
    EXTERNAL_API_V2_URL: str = 'https://s-ql.luzhuofun.com:7050/person/create'
    EXTERNAL_API_V2_AUTH: str = os.environ.get('EXTERNAL_API_V2_AUTH', 'b11ff6608fedf9d5549a')
    EXTERNAL_API_V2_PLATFORM: str = 'novo'

    # V2版本声音克隆API配置
    EXTERNAL_VOICE_V2_URL: str = 'https://s-ql.luzhuofun.com:7050/voice/create'
    EXTERNAL_VOICE_V2_AUTH: str = os.environ.get('EXTERNAL_VOICE_V2_AUTH', 'ec5262a9bf46971c5eea')
    EXTERNAL_VOICE_V2_PLATFORM: str = 'novo'
    EXTERNAL_VOICE_V2_TYPE: str = os.environ.get('EXTERNAL_VOICE_V2_TYPE', 'lite')  # 可配置的voiceType

    # V2版本作品创建API配置
    EXTERNAL_VIDEOMIX_V2_URL: str = 'https://s-ql.luzhuofun.com:7050/videomix/create'
    EXTERNAL_VIDEOMIX_V2_AUTH: str = os.environ.get('EXTERNAL_VIDEOMIX_V2_AUTH', 'ec5262a9bf46971c5eea')
    EXTERNAL_VIDEOMIX_V2_PLATFORM: str = 'novo'

    # MySQL 数据库配置
    MYSQL_HOST: str = 'localhost'
    MYSQL_PORT: int = 3306
    MYSQL_USER: str = 'root'
    MYSQL_PASSWORD: str = '842523563'
    MYSQL_DB: str = 'luzuo'

    # OSS 配置
    OSS_ACCESS_KEY_ID = os.environ.get('OSS_ACCESS_KEY_ID', 'LTAI5tJqWt7ZTeyztkEJTKEd')
    OSS_ACCESS_KEY_SECRET = os.environ.get('OSS_ACCESS_KEY_SECRET', 'LODdZESZzBaDBkJF00DI75zXeHcs6E')
    OSS_BUCKET_NAME = os.environ.get('OSS_BUCKET_NAME', 'xiaorui-assets')
    OSS_ENDPOINT = os.environ.get('OSS_ENDPOINT', 'https://oss-cn-chengdu.aliyuncs.com')
    OSS_ARN = os.environ.get('OSS_ARN','acs:ram::1720616882895990:role/oss')
    OSS_SESSION_NAME = os.environ.get('OSS_SESSION_NAME','sessiontest')

    # TOS视频文件位置
    OSS_VIDEO_TASK : str = 'task'
    OSS_VIDEO_URL : str = 'shuzhiren'
    OSS_AUDIO_URL : str = 'yinpin'
    OSS_ACCESS_AK : str = 'AKLTODc3Y2IyMDM4ZjU4NDg2N2JkYTJlNjY0ZWVkZmYyOTg'
    OSS_ACCESS_SK : str = 'TlRZNE1qQmlNVE5oWm1FNE5ETTBabUkwWWpJNU56bG1OR001WVdSaU5qVQ=='
    TOS_RoleTrn : str = 'trn:iam::2100903486:role/sts'

    # 优速AI地址配置
    YOUSHU_API_URL = os.environ.get('YOUSHU_API_URL','https://gpt.sczhongda88.com/webapi')
    YOUSHU_API_KEY = os.environ.get('YOUSHU_API_KEY','786a1efe6aa841e79daa54990ae6ba5c')

    # 优速AI测试地址配置
    # YOUSHU_API_URL = os.environ.get('YOUSHU_API_URL','https://ai-test-001.sczhongda88.com/webapi')
    # YOUSHU_API_KEY = os.environ.get('YOUSHU_API_KEY','786a1efe6aa841e79daa54990ae6ba5c')

    # V2版本回调地址配置
    V2_CALLBACK_URL = os.environ.get('V2_CALLBACK_URL', 'https://hwserver.luzhuofun.com:8080')
    V2_VOICE_CALLBACK_URL = os.environ.get('V2_VOICE_CALLBACK_URL', 'https://hwserver.luzhuofun.com:8080/api/v2/voice/callback')
    V2_VIDEOMIX_CALLBACK_URL = os.environ.get('V2_VIDEOMIX_CALLBACK_URL', 'https://hwserver.luzhuofun.com:8080/api/v2/videomix/callback')
    
    # 内部API回调地址配置（无需token验证的内部接口）
    INTERNAL_CALLBACK_BASE_URL = os.environ.get('INTERNAL_CALLBACK_BASE_URL', 'https://hwserver.luzhuofun.com:8080')
    INTERNAL_VIDEO_CALLBACK_URL = f"{INTERNAL_CALLBACK_BASE_URL}/api/v1/internal/callback/video"
    INTERNAL_VIDEOMIX_CALLBACK_URL = f"{INTERNAL_CALLBACK_BASE_URL}/api/v1/internal/callback/videomix"

    # 公共声音
    GONGGONG_AUDIO_URL ={
        "code": 200,
        "type": 2,
        "data": [
            {
                "voice_id": 9408,
                "type": 10,
                "title": "热情甜美",
                "audio_url":"https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E7%83%AD%E6%83%85%E7%94%9C%E7%BE%8E.wav"
            },
            {
                "voice_id": 9409,
                "type": 10,
                "title": "儒雅哲学",
                "audio_url":"https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E5%84%92%E9%9B%85%E5%93%B2%E5%AD%A6.wav"
            },
            {
                "voice_id": 9416,
                "type": 10,
                "title": "亲切女声",
                "audio_url": "https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E4%BA%B2%E5%88%87%E5%A5%B3%E7%94%9F.wav"
            },
            {
                "voice_id": 9410,
                "type": 10,
                "title": "黑土 东北老铁",
                "audio_url": "https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E9%BB%91%E5%9C%9F%20%E4%B8%9C%E5%8C%97%E8%80%81%E9%93%81.wav"
            },
            {
                "voice_id": 9411,
                "type": 10,
                "title": "锅锅 重庆小伙",
                "audio_url": "https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E9%94%85%E9%94%85%20%E9%87%8D%E5%BA%86%E5%B0%8F%E4%BC%99.wav"
            },
            {
                "voice_id": 9412,
                "type": 10,
                "title": "聚贤 广西老表",
                "audio_url": "https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E8%81%9A%E8%B4%A4%20%E5%B9%BF%E8%A5%BF%E8%80%81%E8%A1%A8.wav"
            },
            {
                "voice_id": 23966,
                "type": 10,
                "title": "晓敏 粤语女声",
                "audio_url":"https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E6%99%93%E6%95%8F%20%E7%B2%A4%E8%AF%AD%E5%A5%B3%E5%A3%B0.wav"
            },
            {
                "voice_id": 23967,
                "type": 10,
                "title": "晓海 粤语男声",
                "audio_url":"https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E6%99%93%E6%B5%B7%20%E7%B2%A4%E8%AF%AD%E7%94%B7%E5%A3%B0.wav"
            },
            {
                "voice_id": 9413,
                "type": 10,
                "title": "通用女声",
                "audio_url":"https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E9%80%9A%E7%94%A8%E5%A5%B3%E5%A3%B0.wav"
            },
            {
                "voice_id": 9414,
                "type": 10,
                "title": "通用男声",
                "audio_url":"https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E9%80%9A%E7%94%A8%E7%94%B7%E5%A3%B0.wav"
            },
            {
                "voice_id": 9415,
                "type": 10,
                "title": "儒雅青年",
                "audio_url":"https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E9%94%85%E9%94%85%20%E9%87%8D%E5%BA%86%E5%B0%8F%E4%BC%99.wav"
            },
            {
                "voice_id": 9417,
                "type": 10,
                "title": "古风少御",
                "audio_url": "https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E5%8F%A4%E9%A3%8E%E5%B0%91%E5%BE%A1.wav"
            },
            {
                "voice_id": 9418,
                "type": 10,
                "title": "阳光男孩",
                "audio_url":"https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E9%98%B3%E5%85%89%E7%94%B7%E5%AD%A9.wav"
            },
            {
                "voice_id": 7,
                "type": 10,
                "title": "青春热情",
                "audio_url":"https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E9%9D%92%E6%98%A5%E7%83%AD%E6%83%85.wav"
            },
            {
                "voice_id": 6,
                "type": 10,
                "title": "卖场直播",
                "audio_url": "https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E5%8D%96%E5%9C%BA%E7%9B%B4%E6%92%AD.wav"
            },
            {
                "voice_id": 5,
                "type": 10,
                "title": "青年男声",
                "audio_url": "https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E9%9D%92%E5%B9%B4%E7%94%B7%E5%A3%B0.wav"
            },
            {
                "voice_id": 4,
                "type": 10,
                "title": "利落冷静",
                "audio_url": "https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E5%88%A9%E8%90%BD%E5%86%B7%E9%9D%99.wav"
            },
            {
                "voice_id": 2,
                "type": 10,
                "title": "温柔自然",
                "audio_url":"https://luzhuoai.tos-cn-beijing.volces.com/audio_url/%E6%B8%A9%E6%9F%94%E8%87%AA%E7%84%B6.wav"
            }
        ]
    } 

settings = Settings()
